<template>
  <div class="reportFormPage">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">沥青混合料沥青含量、矿料级配试验检测记录表</div>
        <div class="codeText">
          <tr>
            JGLQ11006a
          </tr>
          <tr>
            JGLQ11007
          </tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span v-if="isPdf" class="placeholder">{{ form.jilbh }}</span>
          <el-input class="code-input" v-else type="text" v-model="form.jilbh" @focus="handleFocus('jilbh')" />
        </div>
      </div>
      <div class="table-border">
        <!-- .........................1111111111111111111111111111111......................................................... -->
        <table height="170px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="40" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ placeholder: !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>
                <span>；样品数量：</span>
                <span :class="{ placeholder: !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ placeholder: !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ placeholder: !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%">{{ form.shiytjsd }}</span
                >%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%" />℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%" />%RH
              </td>
            </tr>

            <tr>
              <td height="40" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark" @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView" @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="40" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark" @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="616px" class="middle-table">
          <tbody>
            <tr height="20">
              <td colspan="3">结构层次</td>
              <td colspan="3"><el-input type="text" v-model="form.jiegcc" @change="transmissionData" @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'" /></td>
              <td colspan="3">混合料类型</td>
              <td colspan="3"><el-input type="text" v-model="form.hunhllx" @change="transmissionData" @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'" /></td>
            </tr>
            <tr height="20">
              <td colspan="3">沥青种类标号</td>
              <td colspan="3"><el-input type="text" v-model="form.liqzlbh" @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'" /></td>
              <td colspan="3">最佳沥青用量(%)</td>
              <td colspan="3"><el-input type="text" v-model="form.zuijlqyl" @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'" /></td>
            </tr>
            <tr height="20">
              <td colspan="12">级配试验</td>
            </tr>
            <tr height="20">
              <td rowspan="2">干燥试样质量(g)</td>
              <td colspan="3">第一组</td>
              <td colspan="3">第二组</td>
              <td colspan="5" rowspan="4">平均</td>
            </tr>
            <tr height="20">
              <td colspan="3"><el-input type="text" v-model="form.ganzsyzl1" @change="count075(1)" @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'" /></td>
              <td colspan="3"><el-input type="text" v-model="form.ganzsyzl2" @change="count075(2)" @keydown.native="handleKeyDown($event, 2, 1)" :ref="'2_1'" /></td>
            </tr>
            <tr height="20">
              <td>水洗后筛上总量(g)</td>
              <td colspan="3"><el-input type="text" v-model="form.shuixhsszl1" @change="count075(1)" @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'" /></td>
              <td colspan="3"><el-input type="text" v-model="form.shuixhsszl2" @change="count075(2)" @keydown.native="handleKeyDown($event, 3, 1)" :ref="'3_1'" /></td>
            </tr>
            <tr height="20">
              <td>洗后0.075mm筛下量(g)</td>
              <td colspan="3"><el-input type="text" v-model="form.shuixhsxl1" disabled /></td>
              <td colspan="3"><el-input type="text" v-model="form.shuixhsxl2" disabled /></td>
            </tr>
            <tr height="20">
              <td>0.075mm通过率(g)</td>
              <td colspan="3"><el-input type="text" v-model="form.tonggl1" disabled /></td>
              <td colspan="3"><el-input type="text" v-model="form.tonggl2" disabled /></td>
              <td colspan="5"><el-input type="text" v-model="form.pingj" disabled /></td>
            </tr>
            <tr height="20">
              <td rowspan="2">筛孔尺寸(mm)</td>
              <td rowspan="2">筛上重(g)</td>
              <td rowspan="2">分计筛余(g)</td>
              <td rowspan="2">通过百分率(%)</td>
              <td rowspan="2">筛上重(g)</td>
              <td rowspan="2">分计筛余(g)</td>
              <td rowspan="2">通过百分率(%)</td>
              <td width="10%" rowspan="2">燃烧炉法筛孔通过率修正系数(%)</td>
              <td rowspan="2">通过率(%)</td>
              <td rowspan="2">修正后通过率(%)</td>
              <td colspan="2">通过百分率(%)</td>
            </tr>
            <tr height="20">
              <td>最大值</td>
              <td>最小值</td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[0].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[0].shaisz1" @change="countFjsx(1, 0)" @keydown.native="handleKeyDown($event, 4, 1)" :ref="'4_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[0].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].shaisz2" @change="countFjsx(2, 0)" @keydown.native="handleKeyDown($event, 4, 2)" :ref="'4_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[0].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].xiuzxs" @change="countTonggl(0)" @keydown.native="handleKeyDown($event, 4, 3)" :ref="'4_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[0].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[0].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 4, 4)" :ref="'4_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[0].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 4, 5)" :ref="'4_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[1].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 5, 0)" :ref="'5_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].shaisz1" @change="countFjsx(1, 1)" @keydown.native="handleKeyDown($event, 5, 1)" :ref="'5_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].shaisz2" @change="countFjsx(2, 1)" @keydown.native="handleKeyDown($event, 5, 2)" :ref="'5_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].xiuzxs" @change="countTonggl(1)" @keydown.native="handleKeyDown($event, 5, 3)" :ref="'5_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[1].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 5, 4)" :ref="'5_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[1].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 5, 5)" :ref="'5_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[2].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 6, 0)" :ref="'6_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].shaisz1" @change="countFjsx(1, 2)" @keydown.native="handleKeyDown($event, 6, 1)" :ref="'6_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].shaisz2" @change="countFjsx(2, 2)" @keydown.native="handleKeyDown($event, 6, 2)" :ref="'6_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].xiuzxs" @change="countTonggl(2)" @keydown.native="handleKeyDown($event, 6, 3)" :ref="'6_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[2].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 6, 4)" :ref="'6_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[2].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 6, 5)" :ref="'6_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[3].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 7, 0)" :ref="'7_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].shaisz1" @change="countFjsx(1, 3)" @keydown.native="handleKeyDown($event, 7, 1)" :ref="'7_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].shaisz2" @change="countFjsx(2, 3)" @keydown.native="handleKeyDown($event, 7, 2)" :ref="'7_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].xiuzxs" @change="countTonggl(3)" @keydown.native="handleKeyDown($event, 7, 3)" :ref="'7_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[3].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 7, 4)" :ref="'7_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[3].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 7, 5)" :ref="'7_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[4].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 8, 0)" :ref="'8_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].shaisz1" @change="countFjsx(1, 4)" @keydown.native="handleKeyDown($event, 8, 1)" :ref="'8_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].shaisz2" @change="countFjsx(2, 4)" @keydown.native="handleKeyDown($event, 8, 2)" :ref="'8_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].xiuzxs" @change="countTonggl(4)" @keydown.native="handleKeyDown($event, 8, 3)" :ref="'8_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[4].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 8, 4)" :ref="'8_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[4].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 8, 5)" :ref="'8_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[5].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 9, 0)" :ref="'9_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].shaisz1" @change="countFjsx(1, 5)" @keydown.native="handleKeyDown($event, 9, 1)" :ref="'9_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].shaisz2" @change="countFjsx(2, 5)" @keydown.native="handleKeyDown($event, 9, 2)" :ref="'9_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].xiuzxs" @change="countTonggl(5)" @keydown.native="handleKeyDown($event, 9, 3)" :ref="'9_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[5].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 9, 4)" :ref="'9_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[5].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 9, 5)" :ref="'9_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[6].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 10, 0)" :ref="'10_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].shaisz1" @change="countFjsx(1, 6)" @keydown.native="handleKeyDown($event, 10, 1)" :ref="'10_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].shaisz2" @change="countFjsx(2, 6)" @keydown.native="handleKeyDown($event, 10, 2)" :ref="'10_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].xiuzxs" @change="countTonggl(6)" @keydown.native="handleKeyDown($event, 10, 3)" :ref="'10_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[6].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 10, 4)" :ref="'10_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[6].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 10, 5)" :ref="'10_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[7].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 11, 0)" :ref="'11_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].shaisz1" @change="countFjsx(1, 7)" @keydown.native="handleKeyDown($event, 11, 1)" :ref="'11_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].shaisz2" @change="countFjsx(2, 7)" @keydown.native="handleKeyDown($event, 11, 2)" :ref="'11_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].xiuzxs" @change="countTonggl(7)" @keydown.native="handleKeyDown($event, 11, 3)" :ref="'11_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[7].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 11, 4)" :ref="'11_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[7].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 11, 5)" :ref="'11_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[8].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 12, 0)" :ref="'12_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].shaisz1" @change="countFjsx(1, 8)" @keydown.native="handleKeyDown($event, 12, 1)" :ref="'12_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].shaisz2" @change="countFjsx(2, 8)" @keydown.native="handleKeyDown($event, 12, 2)" :ref="'12_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].xiuzxs" @change="countTonggl(8)" @keydown.native="handleKeyDown($event, 12, 3)" :ref="'12_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[8].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 12, 4)" :ref="'12_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[8].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 12, 5)" :ref="'12_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[9].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 13, 0)" :ref="'13_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].shaisz1" @change="countFjsx(1, 9)" @keydown.native="handleKeyDown($event, 13, 1)" :ref="'13_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].shaisz2" @change="countFjsx(2, 9)" @keydown.native="handleKeyDown($event, 13, 2)" :ref="'13_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].xiuzxs" @change="countTonggl(9)" @keydown.native="handleKeyDown($event, 13, 3)" :ref="'13_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[9].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 13, 4)" :ref="'13_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[9].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 13, 5)" :ref="'13_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[10].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 14, 0)" :ref="'14_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].shaisz1" @change="countFjsx(1, 10)" @keydown.native="handleKeyDown($event, 14, 1)" :ref="'14_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].shaisz2" @change="countFjsx(2, 10)" @keydown.native="handleKeyDown($event, 14, 2)" :ref="'14_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].xiuzxs" @change="countTonggl(10)" @keydown.native="handleKeyDown($event, 14, 3)" :ref="'14_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[10].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 14, 4)" :ref="'14_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[10].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 14, 5)" :ref="'14_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[11].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 15, 0)" :ref="'15_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].shaisz1" @change="countFjsx(1, 11)" @keydown.native="handleKeyDown($event, 15, 1)" :ref="'15_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].shaisz2" @change="countFjsx(2, 11)" @keydown.native="handleKeyDown($event, 15, 2)" :ref="'15_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].xiuzxs" @change="countTonggl(11)" @keydown.native="handleKeyDown($event, 15, 3)" :ref="'15_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[11].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 15, 4)" :ref="'15_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[11].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 15, 5)" :ref="'15_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[12].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 16, 0)" :ref="'16_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].shaisz1" @change="countFjsx(1, 12)" @keydown.native="handleKeyDown($event, 16, 1)" :ref="'16_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].shaisz2" @change="countFjsx(2, 12)" @keydown.native="handleKeyDown($event, 16, 2)" :ref="'16_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].xiuzxs" @change="countTonggl(12)" @keydown.native="handleKeyDown($event, 16, 3)" :ref="'16_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[12].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 16, 4)" :ref="'16_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[12].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 16, 5)" :ref="'16_5'" /></td>
            </tr>
            <tr height="25">
              <td><el-input type="text" v-model="form.detailList[13].shaikcc" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 17, 0)" :ref="'17_0'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].shaisz1" @change="countFjsx(1, 13)" @keydown.native="handleKeyDown($event, 17, 1)" :ref="'17_1'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].fenjsy1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].gonggbfl1" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].shaisz2" @change="countFjsx(2, 13)" @keydown.native="handleKeyDown($event, 17, 2)" :ref="'17_2'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].fenjsy2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].gonggbfl2" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].xiuzxs" @change="countTonggl(13)" @keydown.native="handleKeyDown($event, 17, 3)" :ref="'17_3'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].tonggl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].xiuzhtgl" disabled /></td>
              <td><el-input type="number" v-model="form.detailList[13].zuidz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 17, 4)" :ref="'17_4'" /></td>
              <td><el-input type="number" v-model="form.detailList[13].zuixz" @change="transmissionDetailList" @keydown.native="handleKeyDown($event, 17, 5)" :ref="'17_5'" /></td>
            </tr>

            <tr height="20">
              <td colspan="12">沥青混合料沥青用量(燃烧炉法)</td>
            </tr>
            <tr height="20">
              <td>试验次数</td>
              <td colspan="2">试样蓝和托盘质量m₁
                <!-- <sub>1</sub> -->
                (g)</td>
              <td colspan="2">试样、试样蓝和托盘总质量m₂
                <!-- <sub>2</sub> -->
                (g)</td>
              <td colspan="2">初始试样总质量m₃
                <!-- <sub>3</sub> -->
                (g)</td>
              <td>试样损失质量m
                <sub>4</sub>
                (g)</td>
              <td>标定质量损失系数</td>
              <td>沥青用量(%)</td>
              <td colspan="2">平均值(%)</td>
            </tr>
            <tr height="20">
              <td>1</td>
              <td colspan="2"><el-input type="number" v-model="form.m11" @change="countM3(1)" @keydown.native="handleKeyDown($event, 18, 0)" :ref="'18_0'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.m21" @change="countM3(1)" @keydown.native="handleKeyDown($event, 18, 1)" :ref="'18_1'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.m31" disabled /></td>
              <td><el-input type="number" v-model="form.m41" @change="countLiqyl(1)" @keydown.native="handleKeyDown($event, 18, 2)" :ref="'18_2'" /></td>
              <td rowspan="2"><el-input type="number" v-model="form.biaodzlssxs1" @change="countLqyl" @keydown.native="handleKeyDown($event, 18, 3)" :ref="'18_3'" /></td>
              <td><el-input type="number" v-model="form.liqyl1" disabled /></td>
              <td colspan="2" rowspan="2"><el-input type="number" v-model="form.pingjz" disabled /></td>
            </tr>
            <tr height="20">
              <td>2</td>
              <td colspan="2"><el-input type="number" v-model="form.m12" @change="countM3(2)" @keydown.native="handleKeyDown($event, 19, 0)" :ref="'19_0'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.m22" @change="countM3(2)" @keydown.native="handleKeyDown($event, 19, 1)" :ref="'19_1'" /></td>
              <td colspan="2"><el-input type="number" v-model="form.m32" disabled /></td>
              <td><el-input type="number" v-model="form.m42" @change="countLiqyl(2)" @keydown.native="handleKeyDown($event, 19, 2)" :ref="'19_2'" /></td>
              <td><el-input type="number" v-model="form.liqyl2" disabled /></td>
            </tr>
          </tbody>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="40px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left"></td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%"></td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-left: 20px">年</div>
              <div style="display: inline-block; margin-left: 20px">月</div>
              <div style="display: inline-block ;margin-left: 20px">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import { listLqhhlLqhlkljpjlbBsInfo, getLqhhlLqhlkljpjlbBsInfo, delLqhhlLqhlkljpjlbBsInfo, addLqhhlLqhlkljpjlbBsInfo, updateLqhhlLqhlkljpjlbBsInfo } from "@/api/report_lqhhl/lqhhlLqhlkljpjlbBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView.vue";
import BaQjDetailView from "@/views/sycs/baQjDetail/BaQjDetailView.vue";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView.vue";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

import decimal from "@/utils/big-decimal";
import { handleFocus, emptyConvert, calculateMeanvalue, handleKeyDown } from "@/views/reportForms/utils";
import Bus from "@/utils/bus";
export default {
  name: "lqhhllqhlkljpjlb",
  components: {
    BsInstrumentView,
    BaQjDetailView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      params: {},
      query: {},
      // 表单参数
      form: {
        detailList: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
      }
    };
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  created() {
    this.getInfo();
  },
  methods: {
    // 获取详情
    getInfo() {
      getLqhhlLqhlkljpjlbBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setLqhhllqhlkljpBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setLqhhllqhlkljpBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },

    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    submitForm() {
      return this.form;
    },
    // 平均
    countPingj() {
      let a = this.form.tonggl1;
      let b = this.form.tonggl2;
      if (a && b) {
        this.form.pingj = calculateMeanvalue([a, b], 1);
      }
    },
    // 水洗后0.075mm筛下量(g) 0.075mm通过率(g)
    count075(num) {
      let a = this.form["ganzsyzl" + num];
      let b = this.form["shuixhsszl" + num];
      if (a != null) {
        this.coutFT(num);
      }
      if (a && b) {
        this.form["shuixhsxl" + num] = decimal.round(a - b, 1);
        let c = ((a - b) / a) * 100;
        this.form["tonggl" + num] = decimal.round(c, 1);
        this.countPingj(num);
      }
    },
    // 分计筛余(g)
    countFjsx(type, num) {
      let x = this.form.detailList[num]["shaisz" + type];
      let a = this.form["ganzsyzl" + type];
      let skcc = this.form.detailList[num].shaikcc;
      if (skcc == "底") {
        this.form.detailList[num]["fenjsy" + type] = null;
        this.form.detailList[num]["gonggbfl" + type] = null;
        return;
      }
      if (a && x) {
        let all = (100 * x) / a;
        this.form.detailList[num]["fenjsy" + type] = decimal.round(all, 1);
        this.countTgbfl(type, num);
      } else {
        this.form.detailList[num]["fenjsy" + type] = null;
        this.form.detailList[num]["gonggbfl" + type] = null;
        this.countTonggl(num);
      }
    },
    // 通过百分率(%)
    countTgbfl(type, num) {
      let fenjsyArr = this.form.detailList.map((v) => {
        if (v["fenjsy" + type]) return Number(v["fenjsy" + type]);
      });
      for (let i = 0; i < fenjsyArr.length; i++) {
        if (!fenjsyArr[i]) {
          fenjsyArr[i] = 0;
        }
        if (this.form.detailList[i]["shaisz" + type] != null) {
          let allNumArr = fenjsyArr.slice(0, i + 1);
          const sum = allNumArr.reduce((a, c) => a + c, 0);
          this.form.detailList[i]["gonggbfl" + type] = decimal.subtract(100, sum, 1);
          this.countTonggl(i);
        }
      }
    },
    // 分计筛余&& 通过百分率
    coutFT(num) {
      // let B = this.form["shuixhsszl" + num];
      this.form.detailList.forEach((v, i) => {
        if (v["shaisz" + num] != null) {
          this.countFjsx(num, i);
        }
      });
    },
    // 通过率(%)ping 平均
    countTonggl(num) {
      let a1 = this.form.detailList[num].gonggbfl1;
      let a2 = this.form.detailList[num].gonggbfl2;
      let xiuzxs = this.form.detailList[num].xiuzxs;

      if (!a1 && !a2) {
        this.form.detailList[num].tonggl = null;
        this.form.detailList[num].xiuzhtgl = null;
        return;
      }
      if (a1 != null && a2 != null) {
        this.form.detailList[num].tonggl = calculateMeanvalue([a1, a2], 1);
        this.form.detailList[num].xiuzhtgl = decimal.add(xiuzxs, this.form.detailList[num].tonggl, 1);
      } else if (a1 != null) {
        this.form.detailList[num].tonggl = calculateMeanvalue([a1], 1);
        this.form.detailList[num].xiuzhtgl = decimal.add(xiuzxs, this.form.detailList[num].tonggl, 1);
      } else if (a2 != null) {
        this.form.detailList[num].tonggl = calculateMeanvalue([a2], 1);
        this.form.detailList[num].xiuzhtgl = decimal.add(xiuzxs, this.form.detailList[num].tonggl, 1);
      }
      this.transmissionDetailList();
    },
    // 初始试样总质量m3(g)
    countM3(type) {
      let a = this.form["m1" + type];
      let b = this.form["m2" + type];
      if (a && b) {
        this.form["m3" + type] = decimal.subtract(b, a, 1);
        this.countLiqyl(type);
      }
    },
    countLqyl() {
      this.countLiqyl(1);
      this.countLiqyl(2);
    },
    // 沥青用量(%)
    countLiqyl(type) {
      let c = this.form["m3" + type];
      let d = this.form["m4" + type];
      let e = this.form.biaodzlssxs1;
      if (c && d && e) {
        let f = (d / c) * 100 - e;
        this.form["liqyl" + type] = decimal.round(f, 2);
        this.countPjz();
      }
    },
    // 平均值(%)
    countPjz() {
      let a1 = this.form.liqyl1;
      let a2 = this.form.liqyl2;
      if (a1 && a2) {
        this.form.pingjz = calculateMeanvalue([a1, a2], 2);
        this.transmissionData();
      }
    },
    // 传值
    transmissionDetailList() {
      Bus.$emit("setLqhhlDetailList", this.form.detailList);
    },
    transmissionData() {
      Bus.$emit("setLqhhlPingjz", {
        pingjz: this.form.pingjz, //
        jiegcc: this.form.jiegcc, //结构层次
        hunhllx: this.form.hunhllx, //混合料类型
        liqzlbh: this.form.liqzlbh, //沥青种类标号
        zuijlqyl: this.form.zuijlqyl //最佳沥青用量
      });
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 2];
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped>
</style>
